package com.exam.demo.util.generic;

import com.exam.demo.entity.Paper;
import com.exam.demo.entity.Question;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * 功能描述
 * 遗传算法
 * @author yxj30
 * @date 2022/04/25  17:53
 */
@Service
public class GA {
    /**
     * 变异概率
     */
    private static final double mutationRate = 0.085;
    /**
     * 精英主义
     */
    private static final boolean elitism = true;
    /**
     * 淘汰数组大小
     */
    private static final int tournamentSize = 5;
    /**
     * 种群大小
     */
    private static final int populationSize = 20;

    private static Population population;

    public static ArrayList<Question> makePaper(Paper paper){
        init(paper);
        return null;
    }

    //初始化种群
    public static void init(Paper paper){
        Individual individual = new Individual(paper);
        System.out.println(individual);

    }


    //选择算法

    //交配算法

    //变异算法

    //适应度评价

    //轮盘算法



}
